appDisplay: Clicking outside folders does not consistently close them
This is because the container of the dialog changes sizes after a
refresh, for reasons that are not fully explained. A better condition
is to check explicitly that the click doesn't fall into the dialog.